list = [ 'willliam', 'hyoka', 'spring', 'angel', 'pajamas' ]
aList = [ 'weng', 'google', 'bing' ]

print(list, aList)
print(list[0])
print(list[1:3])
print(list[2:])
print(list[:2])
print(aList * 2)
print(list + aList)
print(list[1:-1:2])
print(list[1::2])
# reverse
print(list[-1::-1])

'''
['willliam', 'hyoka', 'spring', 'angel', 'pajamas'] ['weng', 'google', 'bing']
willliam
['hyoka', 'spring']
['spring', 'angel', 'pajamas']
['willliam', 'hyoka']
['weng', 'google', 'bing', 'weng', 'google', 'bing']
['willliam', 'hyoka', 'spring', 'angel', 'pajamas', 'weng', 'google', 'bing']
['hyoka', 'angel']
['hyoka', 'angel']
['pajamas', 'angel', 'spring', 'hyoka', 'willliam']
'''

# py 的数组 不同于 字符串，是可以修改的: arr[idx]='xxxx'

list[1] = 'ikun'
print(list)
list[1:3] = [ 1, 3, 35 ]
print(list)
list[1:3] = []
print(list)

'''
['willliam', 'ikun', 'spring', 'angel', 'pajamas']
['willliam', 1, 3, 35, 'angel', 'pajamas']
['willliam', 35, 'angel', 'pajamas']
'''